Articles
Nestingarticle
insection
or Vice Versa?
The "article" element specifies independent, self-contained content.
The "section" element defines section in a document.
Can we use the definitions to decide how to nest those elements? No, we cannot!
So, you will find HTML pages with "section" elements containing "article" elements, and "article" elements containing "section" elements.
Source: W3Schools
Can article and section be nested inside each other? How do they behave and what's the basic difference between them?
Html5 header, article, section, aside, footer tags behaves just like plain div tag.
They are used for giving hints to SEO, screen readers what type of content the divisions contain.
Source: sololearn
Is it semantically correct to nest "article" tags in such a manner?
There are cases where nesting article elements is correct; the most prominent case being comments to a blog post.
Good questions to ask whether article is appropriate:
- could the content have an own publication date?
- could the content have a different author than the page?
- could the content be a separate entry in a feed?
- would the content still make sense if it was printed out without any other content/context?
If (some of) these questions are answered with 'yes', article could be correct.
Source: stackOverflow